
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>小程序内嵌webview</title>
    <style>
        .btn {
            font-size: 70px;
            color: red;
        }
    </style>
</head>
<body style="background-color: red;">
<h1>我是webview里的h5页面</h1>
<a id="desc" class="btn" onclick="jumpPay()">按钮</a>

<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<script>
    function jumpPay() {
        let tmpDict = {title:'传递过来的数据'}
        wx.miniProgram.postMessage(tmpDict);
        console.log("点击了按钮")

       /* wx.miniProgram.navigateTo({url: '/path/to/page'})
        wx.miniProgram.postMessage({ data: 'foo' })
        wx.miniProgram.postMessage({ data: {foo: 'bar'} })
        wx.miniProgram.getEnv(function(res) { console.log(res.miniprogram) }) */
    }
</script>
</body>
</html>

